:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --light-bg: #f8f9fa;
    --dark-text: #333;
    --light-text: #fff;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background-color: #f5f7fa;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.logo {
    min-width: 50px;
    min-height: 50px;
    width: 50px;
    height: 50px;
    margin-right: 15px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.logo i {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
h1 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

.chat-container {
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    padding: 20px;
    height: 500px;
    overflow-y: auto;
    margin-bottom: 20px;
    background-color: white;
    box-shadow: var(--shadow);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.chat-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.message {
    margin: 15px 0;
    padding: 14px 16px;
    border-radius: var(--border-radius);
    position: relative;
    max-width: 75%;
    animation: fadeIn 0.3s ease-in-out;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background-color: #e3f2fd;
    margin-left: auto;
    border-bottom-right-radius: 0;
    color: #0d47a1;
}

.bot-message {
    background-color: var(--light-bg);
    margin-right: auto;
    border-bottom-left-radius: 0;
    color: #37474f;
}

.bot-message::before {
    content: '';
    position: absolute;
    left: -10px;
    bottom: 0;
    border-right: 10px solid var(--light-bg);
    border-bottom: 10px solid transparent;
}

.user-message::after {
    content: '';
    position: absolute;
    right: -10px;
    bottom: 0;
    border-left: 10px solid #e3f2fd;
    border-bottom: 10px solid transparent;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bot-avatar {
    background-color: var(--primary-color);
}

.user-avatar {
    background-color: #ff7043;
}

.sender-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.message-time {
    font-size: 0.7rem;
    color: #777;
    margin-left: 10px;
}

.message-content {
    line-height: 1.5;
    font-size: 0.95rem;
}

.input-container {
    display: flex;
    gap: 12px;
    position: relative;
}

textarea {
    flex-grow: 1;
    padding: 15px;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

button {
    padding: 0 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.quick-question {
    background-color: #f1f8fe;
    border: 1px solid #d1e6fa;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.quick-question:hover {
    background-color: #e3f2fd;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.typing-indicator {
    display: flex;
    padding: 10px;
    margin-bottom: 10px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #aaa;
    border-radius: 50%;
    margin: 0 2px;
    animation: typingAnimation 1.5s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

.disclaimer {
    font-size: 0.8rem;
    color: #777;
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    border-top: 1px solid #eee;
}

.department-recommendation {
    margin: 15px 0;
    padding: 15px;
    background-color: #f0f7ff;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .message {
        max-width: 90%;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .chat-container {
        height: calc(100vh - 200px);
    }
}

@media (max-width: 480px) {
    .input-container {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 10px;
    }
    
    textarea {
        height: 40px;
        padding: 8px;
    }

    button {
        height: 40px;
        padding: 0 15px;
    }
    
    .message {
        max-width: 95%;
    }
    
    .quick-questions {
        gap: 5px;
    }
}

/* 状态指示器样式 */
.status-indicator {
    position: fixed;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 1000;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-indicator i {
    font-size: 11px;
}

#jsonStatus {
    top: 5px;
    right: 5px;
    display: none;
}

#apiStatus {
    top: 5px;
    right: 5px;
    display: none;
}

.status-success {
    background-color: #d4edda;
    color: #155724;
}

.status-error {
    background-color: #f8d7da;
    color: #721c24;
}

.status-loading {
    background-color: #f0f0f0;
    color: #333;
}

.status-warning {
    background-color: #fff3cd;
    color: #856404;
}